<?php if(!class_exists('raintpl')){exit;}?><?php $tpl = new RainTPL;$tpl_dir_temp = self::$tpl_dir;$tpl->assign( $this->var );$tpl->draw( dirname("header") . ( substr("header",-1,1) != "/" ? "/" : "" ) . basename("header") );?>

<?php echo uniform('aristo'); ?>
<?php echo jquery_ui('redmond'); ?>

<?php if( $dsfm_lang==en ){ ?>
	<?php echo jquery_validate(); ?>
<?php }else{ ?>
	<?php echo jquery_validate('th'); ?>
<?php } ?>

<div class ="wrapper">

	<div class = "main" id = "reservation">
		<h1 class = "fr"><?php echo $e['online-reservation'];?>
		<?php if( $type==1 ){ ?>
			<span class = "subhead"><b><?php echo $e['group-tour'];?></b></span>
		<?php }else{ ?>
			<span class = "subhead"><b><?php echo $e['water-park-ticket'];?></b></span>
		<?php } ?>
		</h1>

		<div class = "content">

			<form action = "reservation-send.php" method = "post" id = "reservation-form">
			<input type = "hidden" value = "<?php echo $type;?>" name = "type">
			<div class = "ticket-form">
				<h2><?php echo $e['online-reservation'];?></h2>
				<span><?php echo $e['reservation-help'];?></span>
				<img src="http://localhost/waterfantasy/html/images/graphic-ticket.png" style = "position:absolute;left:680px; top:110px;">
				<ul>
					<li><label for = "date"><?php echo $e['date'];?></label>
						<input type = "text" name = "date" id = "datepicker" class = "input validate[required]">
						<img src="http://localhost/waterfantasy/html/images/icon-calendar.png" class = "icon-calendar">
						<div class = "clear"></div>
					</li>
					<li><label for = "adult"><?php echo $e['adult'];?></label>
						<select name = "adult" id = "adult">
							<? for($i=0; $i<=50; $i++){ echo "<option value = '$i'>$i</option>"; } ?>
						</select>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<span class = "price"><?php echo $price['adult'];?> <?php echo $e['baht'];?></span>
						<div class = "clear"></div>
					</li>
					<li><label for = "kids"><?php echo $e['kids'];?></label>
						<select name = "kids" id = "kids">
							<? for($i=0; $i<=50; $i++){ echo "<option value = '$i'>$i</option>"; } ?>
						</select>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<span class = "price"><?php echo $price['kids'];?> <?php echo $e['baht'];?></span>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<span class = "condition">* <?php echo $e['condition-kids'];?></span>
						<div class = "clear"></div>
					</li>
					<li><label for = "guest"><?php echo $e['guest'];?></label>
						<select name = "guest" id = "guest">
							<? for($i=0; $i<=50; $i++){ echo "<option value = '$i'>$i</option>"; } ?>
						</select>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<span class = "price"><?php echo $price['guest'];?> <?php echo $e['baht'];?></span>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<span class = "condition">* <?php echo $e['condition-guest'];?></span>
						<div class = "clear"></div>
					</li>
					<li><label for = "senior"><?php echo $e['senior'];?></label>
						<select name = "senior" id = "senior">
							<? for($i=0; $i<=50; $i++){ echo "<option value = '$i'>$i</option>"; } ?>
						</select>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<span class = "price"><?php echo $price['senior'];?> <?php echo $e['baht'];?></span>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<span class = "condition">* <?php echo $e['condition-senior'];?></span>
						<div class = "clear"></div>
					</li>
					<li style = "border:none">
						<span>* <?php echo $e['condition-baby'];?></span>
					</li>
				</ul>
			</div>

			<div class = "reservation-form">
				<h2><?php echo $e['your-information'];?></h2>
				<ul>
					<li>
						<label for = "firstname"><?php echo $e['firstname'];?> :</label>
						<input type = "text" id = "firstname" name = "firstname"  class = "input validate[required]" style = "margin-right:40px;">
						<label for = "lastname"><?php echo $e['lastname'];?> :</label>
						<input type = "text" id = "lastname" name = "lastname"  class = "input validate[required]">
						<div class = "clear"></div>
					</li>
					<li>
						<label for = "tel"><?php echo $e['telephone'];?> :</label>
						<input type = "text" id = "tel" name = "tel"  class = "input validate[required]" style = "margin-right:40px;">
						<label for = "email"><?php echo $e['email'];?> :</label>
						<input type = "text" name = "email" id = "email" class = "input validate[required,custom[email]]">
						<div class = "clear"></div>
					</li>
					<li>
						<label for = "detail"><?php echo $e['detail'];?> :</label>
						<textarea name = "detail" id = "detail"  class = "input" style = "height:100px; width:520px;"></textarea>
						<div class = "clear"></div>
					</li>
				</ul>
				<span class = "term">
				
				</span>
				<input type = "submit" value = "submit" class = "btn-submit">
				<div class = "clear"></div>
			</div>
			</form>

		</div>
	</div>

	<div class = "sidebar">
		<ul>
			<li><?php echo $e['online-reservation'];?></li>
			<li><a href = "reservation.html?type=1"><?php echo $e['group-tour'];?></a></li>
			<li><a href = "reservation.html?type=2"><?php echo $e['water-park-ticket'];?></a></li>
		</ul>
	</div>
</div>

<script>
$(document).ready(function(){
	$( "#datepicker" ).datepicker({
		dateFormat: "dd-mm-yy",
	});

	$("#reservation-form").validationEngine();

	$("#reservation-form").submit(function(){
		var adult = $("[name='adult']").val();
		var kids = $("[name='kids']").val();
		var guest = $("[name='guest']").val();
		var senior = $("[name='senior']").val();

		var total = adult*1 + kids*1 + guest*1 + senior*1;

		<? if ($type == 1) { ?>
			if(total < 15){
				alert("<?=$e['tour-ticket']?>");
			}
		<? }else{ ?>
			if(total < 1){
				alert("<?=$e['select-ticket']?>");
			}
		<? } ?>
	});

	$(".icon-calendar").click(function(){
		$("#datepicker").focus();
	});

	$("select").uniform();
});
</script>

<?php $tpl = new RainTPL;$tpl_dir_temp = self::$tpl_dir;$tpl->assign( $this->var );$tpl->draw( dirname("footer") . ( substr("footer",-1,1) != "/" ? "/" : "" ) . basename("footer") );?>